<template>
	<view class="">
		<view class="list">
			
			<view class="uni-list bottom_">
				
				<view>
					<view style="text-align: center;background: #EC5C53;color: #fff;width: 100%;border-bottom: 1upx solid #fff;">{{content}}</view>
					<view style="height: 1400upx;overflow: hidden;padding-left: 40upx;background: #EC5C53;">
						<tonyScroll :list="stage1" ></tonyScroll>
					</view>
				</view>
				
			</view>
		</view>
	</view>
</template>

<script>
	import tonyScroll from '@/components/tony-scroll/tony-scroll';
	export default {
		components: {
			tonyScroll, // 滚动区
		},
		data() {
			return {
				res:[],
				openid:'',
				stage1:[],
				type: '',
				speed: 100,
				content: '',
			};
		},
		onLoad:function(e){
			this.type = e.type
			if (this.type == 1) {
				this.speed = 30
				this.content = '完成零售拼单1份排序及奖金'
			}
			if (this.type == 2) {
				this.speed = 30
				this.content = '完成零售拼单5份排序及奖金'
			}
			if (this.type == 3) {
				this.speed = 30
				this.content = '完成团购拼单2份排序及奖金'
			}
			if (this.type == 4) {
				this.speed = 30
				this.content = '完成团购拼单5份排序及奖金'
			}
			if (this.type == 5) {
				this.speed = 30
				this.content = '完成团购拼单10份排序及奖金'
			}
			if (this.type == 6) {
				this.speed = 30
				this.content = '完成团购拼单20份排序及奖金'
			}
			if (this.type == 7) {
				this.speed = 30
				this.content = '完成团购拼单40份排序及奖金'
			}
			// uni.showLoading()
			uni.getStorage({
				key: 'openid',
				success: (res) => {
					this.openid = res.data
					this.setAjax()
				},
				fail: () => {
					uni.navigateTo({
						url: '../../login/login'
					});
				}
			});
		},
		methods:{
			setAjax(){
				this.stage1 = []
				uni.request({
					url: 'https://app.t9y9y9.com/app/index.php?i=4&c=entry&m=ewei_shopv2&do=mobile&r=member.queue&app=1',
					method: 'POST',
					data: {
						openid: this.openid,
						type: this.type
					},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					success: res => {
						uni.hideLoading()
						// let stage1 = []
						for (let i in res.data.stage) {
							this.stage1.push(res.data.stage[i])
						}
						// this.stage1 = stage1
					},
					fail: () => {},
					complete: () => {}
				});
				
			},
			jump(e){
				uni.navigateTo({
					url: e.currentTarget.dataset.src
				});
			},
		}
	}
</script>

<style>
</style>
